{{response.files.append(URL(r=request,c='static',f='jquery.dataTables.min.js'))}}
{{response.files.append(URL(r=request,c='static',f='demo_table.css'))}}
{{extend 'layout.html'}}
<script>
jQuery(document).ready(function(){
    jQuery('.smarttable').dataTable(); 
});
</script>
<h1>Files to/from {{=link_person(person)}}</h1>

[<a href="#nil" onclick="jQuery('#form').slideToggle();">toggle</a>]
<div id="form">
<h2>New Document</h2>
{{=form}}
</div>

<br /><br />
<table class="smarttable">
<thead>
  <tr>
     <th>Uploaded On</th><th>By</th><th>Filename</th><th>Link</th>
  </tr>
</thead>
<tbody>
{{for doc in docs:}}
<tr>
<td>{{=doc.created_on}}</td>
<td>{{=doc.created_by.first_name}} {{=doc.created_by.last_name}}</td>
<td>{{=doc.name}}</td>
<td><a href="{{=URL(r=request,f='download',args=doc.file)}}">file</a></td>
</tr>
{{pass}}
</tbody>
</table>
